﻿using System.Linq;
using Gems;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace GemsTest
{
    [TestClass]
    public class GossipMessageTests
    {
        [TestMethod]
        public void CanDeserialize()
        {
            const string hostname = "deadbeef";
            var matrix = new SuspectMatrix(3, 0, 1, 2);
                 
            var message = new GossipMessage(matrix, hostname);
            var message2 = GossipMessage.FromBytes(message.ToBytes());
            Assert.AreEqual(message.HostName, message2.HostName);
            Assert.AreEqual(message.Matrix, message2.Matrix);
        }
    }
}